home *** CD-ROM | disk | FTP | other *** search
/ United Public Domain Gold 2 / United Public Domain Gold 2.iso / utilities / pu168a.dms / pu168a.adf / Scripts / tutorial23.art < prev    next >
Text File  |  1991-10-26  |  3KB  |  109 lines

  1. !---------------------------------------------------------------
  2. !
  3. ! TUTORIAL23 - RayDance tutorial script #23.
  4. !
  5. ! This script demonstrates replicas and haze.
  6. !
  7. ! Concepts include :
  8. !
  9. !  o Replicas
  10. !  o Haze
  11. !  o Boundary volumes
  12. !
  13. ! NOTE: Be sure to click on the HAZE gadget in the Command
  14. ! Window of the user interface.
  15. !
  16. !---------------------------------------------------------------
  17.  
  18. ? "TUTORIAL23 - This script uses replicas to create several\n",
  19.   "rows of columns.  Atmospheric haze is specified so they\n",
  20.   "fade off into the distance.\n\n",
  21.   "NOTE: Be sure HAZE is enabled on the Command Window!\n\n";
  22.  
  23. ! Variables
  24. real  Y;
  25.  
  26. ! Load the maps
  27. BRICKS_TXA : texturemap( "bricks4.ilbm" );
  28. BRICKS_BMA : bumpmap( "brickbumps4b.ilbm" );
  29.  
  30. ! Create colors
  31. YELLOW : color( RGB, [.8,.8,.1] );
  32.  
  33. ! Create surfaces for our stuff.
  34. MATTE : surface(PHONG, 0.4,.8, 0, 0, 0,0,0, 0, 0 );
  35. SHINY : surface(PHONG, 0.4,.8,.4,30, 0,0,0, 0, 0 );
  36.  
  37. ! Create the bump and texture maps for the ground plane.  Note
  38. ! that the width and height parameters must be the same or it
  39. ! won't work right.
  40. TXTURE : texture( PLANE, BRICKS_TXA, [0,0,0],
  41.   [0,0,1], [1,0,0], 100,100,100, 1,1, REPEAT SMOOTH3 );
  42.  
  43. BUMPS : bump( PLANE, BRICKS_BMA, MATTE, 1.0, [0,0,0],
  44.   [0,0,1], [1,0,0], 100,100,100, 1,1, REPEAT );
  45.  
  46. ! Our ground is covered with bricks.
  47. GROUND( PLAIN, 0, TXTURE, BUMPS );  ! Below sea level
  48.  
  49. ! Build the first object using the an imported outline and two
  50. ! lathe statements.  Enclose this object in a NAMED boundary for
  51. ! later use in the REPLICAS
  52. COLUMN_OUTLINE : outline( "column_outline.geo", [1,1,4], xz );
  53.  
  54. COLUMN : boundary( [200,0,0] )  ! a named and positioned boundary
  55.  
  56. ! Column base
  57.   lathe( ( [0,0,0], [20,20,0], [20,20,4], [0,0,4] ),
  58.     4, -360, 0, [ 2,2,2], [200,0,0], [0,0,0],
  59.     YELLOW, SHINY, ZAXIS );
  60.  
  61. ! Column proper
  62.   lathe( ( column_outline ),
  63.     25, -360, 0, [2,2,2], [200,0,4], [0,0,0],
  64.       YELLOW, SHINY, PHONG ZAXIS );
  65.  
  66. endboundary
  67.  
  68.  
  69. ! Now use looping to create rows of columns...
  70. Y = 0;
  71. while (Y < 5000) {
  72. !           parent    pos      rotation
  73.   if (Y > 500) {
  74.     replica( COLUMN, [-1000,Y,0], [0,0,0] );
  75.   }
  76.   replica( COLUMN, [-600,Y,0], [0,0,0] );
  77.   replica( COLUMN, [-200,Y,0], [0,0,0] );
  78.   if (Y > 0) {
  79.     replica( COLUMN, [200,Y,0], [0,0,0] );
  80.   }
  81.   replica( COLUMN, [600,Y,0], [0,0,0] );
  82.   if (Y > 500) {
  83.     replica( COLUMN, [1000,Y,0], [0,0,0] );
  84.   }
  85.   Y = Y + 500;
  86. }
  87.  
  88. ! Specify the lighting.
  89. AMBIENT( [0,0,0], [0.6,0.6,0.6], [0,0,1], 0, 0 );
  90. STAR( [40000,-50000,60000], [1,.9,1], 300 );
  91.  
  92. ! A sky background.  Horizon will be quite light and hazy.
  93. ! The zenith will be darker,
  94. !                hor color   zen color   nad color  factor
  95. BACKGROUND( SKY, [.8,.7,.7], [.1,.3,.6], [.8,.7,.7], .7 );
  96.  
  97. ! The haze will derive its color from the background (sky).
  98. !         mode       zen    hor   nad   change start max
  99. !                    vis    vis   vis    rate   dis  haze
  100. SETHAZE( BACKGROUND, 10000, 5000, 10000, .8,    0,    1 );
  101.  
  102. ! The camera looks up the positive y axis
  103. CAMERA'POS = [0,-1000,250];
  104. CAMERA'TARGET = [0,0,250];
  105.  
  106. RENDER;
  107.  
  108. END
  109.